<template>
  <el-container>
    <el-header class="header">
     <el-form label-width="100px">
        <el-row>
          <el-col :span="6">
            <el-form-item label="医院名称：">
              <el-input class="com-input" placeholder="请输入医院名称" v-model="comName" />
            </el-form-item>
          </el-col>  
          <el-col :span="6">
            <el-form-item label="医院等级：">
              <el-select v-model="gradeValue" class="com-input" placeholder="全部">
                <el-option v-for="item in hosGrade" :key="item.id" :label="item.dValue" :value="item.dKey" />
              </el-select>
            </el-form-item>
          </el-col>  
          <el-col :span="12">
            <el-form-item label="地区：">
            <user-address ref="address"/>
            </el-form-item>
          </el-col>  
        </el-row> 
        <el-row>
          <el-col :span="18">
            <el-form-item label="医院性质：">
              
                  <el-checkbox v-model="shebao" label= true>社保医院</el-checkbox>
                  <el-checkbox v-model="zhifu" label= true>直付医院</el-checkbox>
                  <el-checkbox v-model="mianya" label= true>住院免押金</el-checkbox>
                  <el-checkbox v-model="publicTrans" label= true>对公转账医院</el-checkbox>
                  <el-checkbox v-model="register" label= true>注册</el-checkbox>
                  <el-checkbox v-model="authentication" label= true>认证</el-checkbox>
                  <el-checkbox v-model="choose" label= true>优选</el-checkbox>
              
            </el-form-item>
          </el-col>  
          <el-col :span="6">
             <el-button type="primary" icon="el-icon-search" class="btn" @click="search">查询</el-button>
             <el-button type="primary" @click="addCom" class="btn">新增医院</el-button>
          </el-col>  
        </el-row> 
      </el-form> 
    </el-header>
  </el-container>
</template>
<script>
import { hosLevelList } from "data/listBody"
import UserAddress from "components/address";
export default {
  name: "hosOptions",
  data() {
    return {
      hosGrade: hosLevelList, //医院等级
      comName: "",
      gradeValue: "",
      shebao:"",
      zhifu:"",
      mianya:"",
      publicTrans:"",
      register:"",
      authentication:"",
      choose:""
    };
  },
  components: {
    UserAddress
  },
  methods: {
    addCom() {
      this.$router.push("hospitalAdd?type=add");
    },
    search(){
      this.$emit("search");
    },
    getData(){
      let params = {
        shebao:this.shebao,
        zhifu:this.zhifu,
        mianya:this.mianya,
        publicTrans:this.publicTrans,
        level: this.gradeValue, //医院等级
        name: this.comName, //医院名称
        register:this.register,
        authentication:this.authentication,
        choose:this.choose
      }
      return this.lodash.assign({},params,this.$refs.address.getData());
    }
  }
};
</script>
<style lang="less" scoped>
@import url("./../../../../assets/less/color.less");
.header {
  border-bottom: 1px solid @border-gray;
  height: inherit !important;
  padding-bottom: 10px;
}
</style>